﻿using System;
using System.Threading;

/// <summary>
/// 观察者模式实现
/// </summary>
namespace ObserverPattern
{
    class Program
    {
        static void Main(string[] args)
        {
            Subject subject = new Subject();

            new HexaObserver(subject);
           
            new BinaryObserver(subject);

            Console.WriteLine("设置为19");
            subject.SetState(19);
            Thread.Sleep(2000);


            Console.WriteLine("设置为15");
            subject.SetState(15);
            Thread.Sleep(2000);

        }
    }
}
